﻿using System.Windows.Navigation;

namespace DataImporterExporter
{
    /// <summary>
    /// Interaction logic for WizardDialogBox.xaml
    /// </summary>
    public partial class WizardDialogBox : NavigationWindow
    {
        private WizardData wizardData;

        public WizardDialogBox()
        {
            InitializeComponent();

            // Launch the wizard
            WizardLauncher wizardLauncher = new WizardLauncher();
            wizardLauncher.WizardReturn += new WizardReturnEventHandler(wizardLauncher_WizardReturn);
            this.Navigate(wizardLauncher);
        }

        private void wizardLauncher_WizardReturn(object sender, WizardReturnEventArgs e)
        {
            // Handle wizard return
            wizardData = e.Data as WizardData;
            if (this.DialogResult == null)
            {
                this.DialogResult = (e.Result == WizardResult.Finished);
            }
        }
    }
}
